1. Field of the Invention
The present invention relates to a priority encoder and a floating-point normalization system, more particularly to a priority encoder with a capability of comparing a difference of size among inputs and to a floating-point normalization system for IEEE 754 standard having a higher-operational efficiency.
2. Description of the Prior Art
Recently, it is more required to provide a LSI (Large Scale Integration) having a capability of the floating-point operation based on the IEEE 754 standard.
The IEEE 754 standard comprises a sign, an exponent, and a mantissa.
As an expression format thereof, a normalized number and a denormalized number are defined. For example, a 32-bit single normalized number is expressed as the following equation, in which it is assumed that an implicit leading significant bit is one (1):
______________________________________ Normalized number = (-1)* .times. (1. Mantissa) .times. 2.sup.(Exponent - 127) ______________________________________ where the symbol "*" denotes a sign.
Hereinafter, the left end in the expression format of the exponent and the mantissa means the Most Significant Bit (MSB). The right end in the expression format of them indicates the Least Significant Bit (LSB).
On the other hand, in case where an absolute value of a number is smaller than a predetermined number, namely, when the value of the exponent of the number is zero (0) or when it is impossible to set the one (1) on the implicit leading significant bit, the number can be expressed by a denormalized number such as the following equation:
______________________________________ Denormalized number = (-1)* .times. (0. Mantissa) .times. 2.sup.(Exponent - 126) ______________________________________ where the symbol "*" denotes a sign.
The floating-point calculator satisfying the IEEE 754 standard inputs numbers formed according to the IEEE 754 standard and outputs the result after converts into the IEEE 754 standard format.
FIG. 1 shows a block diagram according to a conventional floating-point normalization system. Referring to the drawings, the conventional normalization system will now be described.
To output a normalized number from the normalization system, a mantissa of an input number is given into a priority encoder 1, and then it is detected that where the first one (1) stands on observed from the MSB of the mantissa of the input number.
The mantissa of the input number is shifted toward the MSB in accordance with the output provided by the priority encoder 1 by using a left-direction barrel shifter 2 for arranging the format of the input number.
As a value obtained by shifting the mantissa of a number toward the MSB is equal to two times as large as the number, a substractor 3 is provided for the exponent in the normalization system. By this subtractor 3, the exponent is substracted by the number of shift of the mantissa transferred toward the MSB.
It seems to be shifted by one or more bit for the implicit leading significant bit. But usually calculators expand the implicit leading significant bit before the calculation. Accordingly, the mantissa can get rejecting the MSB of the number mentioned above.
When the number of exponent is less than the number of the shifting which is adequately required for normalization of the mantissa, the output of the normalization system is not a normalized number. In this case, a denormalized number defined by the IEEE 754 standard is outputted from the normalization system. Namely, the exponent of the normalized number is set to zero (0) after the mantissa is shifted toward the MSB by the number at which the exponent becomes zero (0).
Moreover, the mantissa is shifted toward the LSB by one (1) bit when the normalized number is outputted because the implicit leading significant bit is zero (0) in the denormalized number.
There is a problem that it takes much time to determine whether a number outputted from the conventional normalization system is a normalized number or not. Moreover, there is another problem that it is difficult to determine whether the output of the normalization system is a normalized number or not, before the normalized number is outputted from the normalization system. This determination can be achieved by seeing the exponent of the normalized number outputted from the conventional normalization system.
Accordingly, when the resultant value obtained by subtracting the output of the priority encoder 1 from the exponent is zero (0) or negative, an operation for the denormalized number is performed. The barrel shifter 2 for shifting the mantissa toward the MSB can be performed only after the subtraction of the exponent is finished.
While, each bit in the mantissa is checked by the priority encoder 1 for detecting the first position observed from the MSB in the format of the mantissa, so that it is difficult to make the priority encoder 1 fast.
Moreover, it is also difficult to execute speedy the subtractor 3 in which a propagation of carry is fast performed from the LSB to the MSB in the mantissa.
In the floating-point normalization system, the priority encoder 1 and subtractor 2 is used, so that it is difficult to increase the total operation speed of the normalization system.
As described above, there is the problem that it takes much time to determine whether an input number is able to be a normalized number or a denormalized number.